[nexus] instance create: make hostname
param optional
#6824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
hostname
isNone
in the create request body, use the instance name.Related to #68. There's pretty extensive discussion on there, but it's over two years old — what are hostnames for, could we just get rid of the param entirely, etc. But the change I've made here is a superficial one that we could make right away without much downside that I can see. I was going to make this change on the CLI layer, but then I realized it could just be done here and the CLI would get it for free.
Note that in #4938 we started validating hostname:
omicron/common/src/api/external/mod.rs
Lines 822 to 872 in 2dcf896
but it doesn't follow the same rules as
Name
. It seems to be a little broader: allowing up to 253 characters, not disallowing UUIDs, allowing.
. So this can work as long as we are confident that any valid name is also a valid hostname. It seems true, but I am planning on adding some tests to help ensure it.